package tgc.edu.exam.entity;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.springframework.data.annotation.CreatedBy;

import tgc.edu.exam.custom.BaseEntity;

/***
 * 课程安排
 * 
 * @author Administrator
 *
 */
@Entity
public class CurriculumPlan extends BaseEntity<UUID> {

	private Date starttime;// 开始时间
	private Date finishttime;// 结束时间
	/*private Teacher teacher;*/
	private TbClass tbClass;
	private TbCurriculum curriculum;
	private String startdata;	//日期
	private String finishtime;	//时间
	private Integer rs;	//上过人数

	public Date getStarttime() {
		return starttime;
	}
	public void setStarttime(Date starttime) {
		this.starttime = starttime;
	}
	public Date getFinishttime() {
		return finishttime;
	}
	public void setFinishttime(Date finishttime) {
		this.finishttime = finishttime;
	}

	/*@ManyToOne
	@CreatedBy
	public Teacher getTeacher() {
		return teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}*/

	@ManyToOne
	@CreatedBy
	public TbClass getTbClass() {
		return tbClass;
	}

	public void setTbClass(TbClass tbClass) {
		this.tbClass = tbClass;
	}

	@ManyToOne
	@CreatedBy
	public TbCurriculum getCurriculum() {
		return curriculum;
	}

	public void setCurriculum(TbCurriculum curriculum) {
		this.curriculum = curriculum;
	}
	
	public String getStartdata() {
		return startdata;
	}
	public void setStartdata(String startdata) {
		this.startdata = startdata;
	}
	public String getFinishtime() {
		return finishtime;
	}
	public void setFinishtime(String finishtime) {
		this.finishtime = finishtime;
	}
	public Integer getRs() {
		return rs;
	}
	public void setRs(Integer rs) {
		this.rs = rs;
	}
	@Transient
	public String getStringStarttime() {
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.format(getStarttime());
	}
	
	@Transient
	public String getStringFinishttime() {
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		return sdf.format(getFinishttime());
	}
	public CurriculumPlan(UUID id, Boolean isUsed, String createName, String createDate, String updateName,
			String updateDate, Date starttime, Date finishttime, TbClass tbClass,
			TbCurriculum curriculum, String startdata, String finishtime, Integer rs) {
		super(id, isUsed, createName, createDate, updateName, updateDate);
		this.starttime = starttime;
		this.finishttime = finishttime;
		this.tbClass = tbClass;
		this.curriculum = curriculum;
		this.startdata = startdata;
		this.finishtime = finishtime;
		this.rs = rs;
	}
	public CurriculumPlan() {
		super();
		// TODO Auto-generated constructor stub
	}
	public CurriculumPlan(UUID id, Boolean isUsed, String createName, String createDate, String updateName,
			String updateDate) {
		super(id, isUsed, createName, createDate, updateName, updateDate);
		// TODO Auto-generated constructor stub
	}
	public CurriculumPlan(UUID id, Boolean isUsed) {
		super(id, isUsed);
		// TODO Auto-generated constructor stub
	}
	public CurriculumPlan(UUID id) {
		super(id);
		// TODO Auto-generated constructor stub
	}
	
}
